package test.src.内部类与异常类;

interface speakHello {
    void speak();
}

class helloMachine {
    public void turnOn(speakHello SH) {
        SH.speak();
    }
}

public class Example7_4 {
    public static void main(String[] args) {
        helloMachine machine = new helloMachine();
        machine.turnOn(()-> {
            System.out.println("hello, you are welcome!");
        });
        machine.turnOn(()-> {
            System.out.println("你好, 欢迎光临！");
        });
    }
}
